package com.example.renshiguanli.mapper;

import com.example.renshiguanli.pojo.Appraise;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AppraiseMapper {
//    查询所有
    List<Appraise> findAll();
//    添加员工
    @Insert("insert into appraise (id,eid,appDate,appResult,appContent,remark) values (#{id},#{eid},#{appDate},#{appResult},#{appContent},#{remark})")
    void add(Appraise appraise);
//    根据id查询信息
    @Select("select * from appraise where id=#{id}")
    Appraise findById(Integer id);
//    修改信息
    @Update(" update appraise\n" +
            "        set eid = #{eid},\n" +
            "            appDate = #{appDate},\n" +
            "            appResult = #{appResult},\n" +
            "            appContent = #{appContent},\n" +
            "            remark = #{remark}\n" +
            "        where id = #{id}")
    void updateByAppraise(Appraise appraise);
//    删除信息
    @Delete("delete from appraise where id=#{id}")
    void deleteByAppraise(Integer id);
//    查找信息
    List<Appraise> query(String name);
}
